<div class="row-content am-cf">
	<div class="row">
		<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
			<div class="widget am-cf">
				<div class="widget-head am-cf">
					<div class="widget-title am-fl">编辑预约</div>
					<div class="widget-function am-fr">
						<a href="javascript:;" class="am-icon-cog"></a>
					</div>
				</div>
				<div class="widget-body am-fr">
					<form class="am-form tpl-form-line-form" id="baseForm" method="post" >
						<input type="hidden" id="id"  name="id" th:value="${record.id}"/> 
						<div class="am-form-group">
							<label for="title" class="am-u-sm-2 am-form-label">标题
								<span class="tpl-form-line-small-title">Title</span>
							</label>
							<div class="am-u-sm-10">
								<input type="text" id="title" class="tpl-form-input" placeholder="请输入标题" name="title" th:value="${record.title}"/> 
							</div>
						</div>
						<div class="am-form-group">
							<label for="state" class="am-u-sm-2 am-form-label">状态
								<span class="tpl-form-line-small-state">State</span>
							</label>
							<div class="am-u-sm-10">
								<select id="state" data-am-selected=""  style="display: none;" name="state">
							        <option value="3" selected="${state==3}">预约</option>
							        <option value="2" selected="${state==2}">处理中</option>
							        <option value="1" selected="${state==1}">完成</option>
								</select>
								
							</div>
						</div>
						
						<div class="am-form-group">
							<div class="am-u-sm-10 am-u-sm-push-2">
								
								<button type="button" onclick="return doSubmit();"
									class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
										<button type="button" onclick="loadPage('subscribe/listUI')"
									class="am-btn am-btn-success tpl-btn-bg-color-success ">返回</button>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>

	</div>
	<script th:inline="javascript">
	<![CDATA[
	$('select').selected();
		validateUserForm();
		
		var valdater;
		function validateUserForm(){ 
			valdater=$('#baseForm').validate({
		        errorElement : 'span',
		        errorClass : 'am-icon-times',
		        focusInvalid : true,
		        onkeyup:false,
		        ignore : "",
		        rules : {
		        	title : {
		                required : true
		            }
		        },
		        messages : {
		        	name : {
		                required : "请填写标题"
		            }
		        }
		    });
		}
		
		function doSubmit(){
			 if(valdater.form()){
				commit('baseForm', 'subscribe/save', 'subscribe/listUI');
			  return true;
			 }
			  return false;
		}
		
	
		
		]]>
	</script>